<template>
        <div>
            <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item :to="{ path: '/Welcome' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>日志查看</el-breadcrumb-item>
      <el-breadcrumb-item>登陆日志</el-breadcrumb-item>
    </el-breadcrumb>
        <el-table :data="this.loginLogList.data" border stripe >
        <el-table-column label="操作者" prop="username" align="center"></el-table-column>
        <el-table-column label="操作内容" prop="operation" align="center"></el-table-column>
        <el-table-column label="执行时间(毫秒)" prop="time" align="center"></el-table-column>
        <el-table-column label="IP地址" prop="ip" align="center"></el-table-column>
        <el-table-column label="时间" prop="createDate" align="center"></el-table-column>
      </el-table>
      <!-- 分页区域 -->
      <el-pagination background
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="this.queryInfo.page"
      :page-sizes="[1, 2, 5, 10, 20]"
      :page-size="this.queryInfo.limit"
      layout="total, sizes, prev, pager, next, jumper"
      :total="this.totalNum">
    </el-pagination>
        </div>
</template>
<script>
export default {
  data () {
    return {
      loginLogList: {},
      queryInfo: {
        page: 1,
        limit: 10,
         type: 1
      },
      totalNum: 100
    }
  },
  created () {
    this.getLoginLogList()
  },
  methods: {
    getLoginLogList () {
      this.$api.log.getLoginLog(this.queryInfo).then(res => {
        this.loginLogList = res.data
        this.totalNum = res.data.count
      })
    },
    handleSizeChange (newSize) {
      this.queryInfo.limit = newSize
      this.getLoginLogList()
    },
    handleCurrentChange (newPage) {
      console.log('页数'+newPage)
      this.queryInfo.page = newPage
      this.getLoginLogList()
    }
  }
}
</script>
<style lang="less" scoped>

</style>
